# -*- coding: utf-8 -*-  
"""  
@author     : Mengnf  
@github     : https://gitee.com/mengnf  
@software   : PyCharm   
@file       : routing.py  
@create     : 2024-11-17 13:15  
@description：
"""

import os

import django

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'drf_admin.settings.dev')
from channels.routing import ProtocolTypeRouter, URLRouter
from django.urls import re_path

from drf_admin.utils.websocket import TokenAuthMiddleware
from monitor.consumers import service

django.setup()
application = ProtocolTypeRouter({
    'websocket': TokenAuthMiddleware(
        URLRouter([
            re_path(r'^monitor/service', service.ResourcesConsumer),
        ])
    )
})
